Current AC building systems do not use locally-generated renewable energy in the most cost effective way and require a very reliable utility grid connection, resulting in excess life-cycle costs as well as energy security concerns. It is known to utilize batteries as an energy buffer for a PV array, but such systems do not eliminate wasteful AC conversions when addressing the most common building electrical loads, such as lighting and ventilation. Likewise, it is known to provide a smart building energy management system, but such systems do not incorporate a DC microgrid to improve efficiency and energy security. FIG. 1 is a block diagram of one embodiment of a conventional AC reference system for comparison with the present invention.